---
title: Features
description: Technical features and integration guides
group: DEVELOPMENT
---

# Features

Explore Syncora's technical features and integration capabilities. From SDKs to APIs, we provide everything you need to integrate synthetic data generation into your applications.

## SDK & Libraries

### JavaScript/TypeScript SDK

Our official SDK for Node.js and browser environments.

**Key Features:**

- **TypeScript support** with full type definitions
- **Promise-based API** for async operations
- **Error handling** with detailed error messages
- **Retry logic** for network failures
- **Streaming support** for large datasets

**Installation:**

```bash
npm install @syncora/sdk
```

**Quick Start:**

```javascript
import { SyncoraClient } from "@syncora/sdk";

const client = new SyncoraClient({
  apiKey: "your-api-key",
});

const dataset = await client.generateData({
  schema: {
    users: {
      fields: {
        name: "string",
        email: "email",
        age: "number",
      },
      count: 1000,
    },
  },
});
```

### Python SDK

Native Python library for data science and ML workflows.

**Installation:**

```bash
pip install syncora-sdk
```

**Usage:**

```python
from syncora import SyncoraClient

client = SyncoraClient(api_key="your-api-key")

dataset = client.generate_data({
    "users": {
        "fields": {
            "name": "string",
            "email": "email",
            "age": "number"
        },
        "count": 1000
    }
})
```

### REST API

Direct HTTP access to all platform features.

**Base URL:** `https://api.syncora.ai/v1`

**Authentication:**

```bash
curl -H "Authorization: Bearer YOUR_API_KEY" \
     https://api.syncora.ai/v1/datasets
```

## API Key Management

### Generating API Keys

1. **Login** to your Syncora account
2. **Navigate** to Settings → API Keys
3. **Click** "Generate New API Key"
4. **Name** your key descriptively
5. **Copy** and store securely

### Key Permissions

- **Read**: Access to view datasets and schemas
- **Write**: Create and modify datasets
- **Admin**: Full account management access

### Security Best Practices

- **Store keys securely** in environment variables
- **Rotate keys regularly** (every 90 days)
- **Use different keys** for different environments
- **Monitor usage** for unusual activity

## Data Generation

### Schema Definition

Define your data structure with our flexible schema language.

**Basic Schema:**

```javascript
{
  users: {
    fields: {
      id: 'uuid',
      name: 'string',
      email: 'email',
      age: 'number',
      created_at: 'datetime'
    },
    count: 1000
  }
}
```

**Advanced Schema:**

```javascript
{
  users: {
    fields: {
      id: 'uuid',
      name: 'string',
      email: 'email',
      age: 'number',
      income: 'number',
      city: 'string'
    },
    constraints: {
      age: 'min:18, max:100',
      income: 'min:20000, max:200000',
      email: 'unique'
    },
    relationships: {
      orders: 'has_many'
    },
    count: 1000
  },
  orders: {
    fields: {
      id: 'uuid',
      user_id: 'reference:users.id',
      amount: 'number',
      status: 'enum:pending,completed,cancelled',
      created_at: 'datetime'
    },
    count: 5000
  }
}
```

### Data Types

- **Primitive Types**: string, number, boolean, datetime
- **Special Types**: email, phone, uuid, url
- **Complex Types**: object, array, enum
- **Reference Types**: reference to other tables

### Constraints & Validation

- **Range constraints**: min/max values
- **Format validation**: email, phone, url patterns
- **Uniqueness**: unique field values
- **Conditional logic**: if/then relationships

## Integration Examples

### Web Application

```javascript
// React component for data generation
import React, { useState } from "react";
import { SyncoraClient } from "@syncora/sdk";

function DataGenerator() {
  const [loading, setLoading] = useState(false);
  const [data, setData] = useState(null);

  const generateData = async () => {
    setLoading(true);
    try {
      const client = new SyncoraClient({
        apiKey: process.env.REACT_APP_SYNCORA_API_KEY,
      });

      const result = await client.generateData({
        schema: {
          users: {
            fields: {
              name: "string",
              email: "email",
              age: "number",
            },
            count: 100,
          },
        },
      });

      setData(result);
    } catch (error) {
      console.error("Generation failed:", error);
    } finally {
      setLoading(false);
    }
  };

  return (
    <div>
      <button onClick={generateData} disabled={loading}>
        {loading ? "Generating..." : "Generate Data"}
      </button>
      {data && <pre>{JSON.stringify(data, null, 2)}</pre>}
    </div>
  );
}
```

### Data Pipeline

```python
# Python script for automated data generation
import pandas as pd
from syncora import SyncoraClient
import schedule
import time

def generate_daily_dataset():
    client = SyncoraClient(api_key="your-api-key")

    schema = {
        "transactions": {
            "fields": {
                "id": "uuid",
                "amount": "number",
                "category": "string",
                "timestamp": "datetime"
            },
            "count": 10000
        }
    }

    dataset = client.generate_data(schema)

    # Convert to DataFrame
    df = pd.DataFrame(dataset['transactions'])

    # Save to file
    df.to_csv(f"transactions_{pd.Timestamp.now().date()}.csv", index=False)
    print(f"Generated {len(df)} transactions")

# Schedule daily generation
schedule.every().day.at("00:00").do(generate_daily_dataset)

while True:
    schedule.run_pending()
    time.sleep(60)
```

### Machine Learning Workflow

```python
# ML pipeline with synthetic data
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.ensemble import RandomForestClassifier
from syncora import SyncoraClient

# Generate training data
client = SyncoraClient(api_key="your-api-key")

training_schema = {
    "customers": {
        "fields": {
            "age": "number",
            "income": "number",
            "credit_score": "number",
            "purchase_amount": "number",
            "churned": "boolean"
        },
        "count": 10000
    }
}

training_data = client.generate_data(training_schema)
df = pd.DataFrame(training_data['customers'])

# Prepare features and target
X = df[['age', 'income', 'credit_score', 'purchase_amount']]
y = df['churned']

# Split and train
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
model = RandomForestClassifier()
model.fit(X_train, y_train)

# Evaluate
accuracy = model.score(X_test, y_test)
print(f"Model accuracy: {accuracy:.2f}")
```

## Advanced Features

### Streaming Data

Generate large datasets without memory issues.

```javascript
const stream = await client.generateDataStream({
  schema: {
    users: {
      fields: {
        /* ... */
      },
      count: 1000000,
    },
  },
});

for await (const batch of stream) {
  console.log(`Received ${batch.length} records`);
  // Process batch
}
```

### Custom Generators

Define your own data generation logic.

```javascript
const customGenerator = {
  name: "custom_user",
  generate: (context) => {
    const firstName = context.faker.name.firstName();
    const lastName = context.faker.name.lastName();
    return {
      name: `${firstName} ${lastName}`,
      email: `${firstName.toLowerCase()}.${lastName.toLowerCase()}@example.com`,
      age: context.faker.datatype.number({ min: 18, max: 80 }),
    };
  },
};

const dataset = await client.generateData({
  schema: {
    users: {
      generator: "custom_user",
      count: 1000,
    },
  },
  generators: [customGenerator],
});
```

### Data Export Formats

- **JSON**: Standard JavaScript object notation
- **CSV**: Comma-separated values
- **Parquet**: Columnar storage format
- **SQL**: Database insert statements
- **Excel**: Spreadsheet format

## Error Handling

### Common Errors

```javascript
try {
  const dataset = await client.generateData(schema);
} catch (error) {
  switch (error.code) {
    case "INVALID_SCHEMA":
      console.error("Schema validation failed:", error.details);
      break;
    case "RATE_LIMIT_EXCEEDED":
      console.error("Rate limit exceeded, retry later");
      break;
    case "INSUFFICIENT_QUOTA":
      console.error("Account quota exceeded");
      break;
    default:
      console.error("Unexpected error:", error.message);
  }
}
```

### Retry Logic

```javascript
import { retry } from "@syncora/sdk/utils";

const generateWithRetry = retry(client.generateData, {
  maxAttempts: 3,
  backoff: "exponential",
  baseDelay: 1000,
});

const dataset = await generateWithRetry(schema);
```

## Performance Optimization

### Batch Processing

```javascript
// Generate data in batches
const batchSize = 10000;
const totalRecords = 100000;
const batches = [];

for (let i = 0; i < totalRecords; i += batchSize) {
  const batch = await client.generateData({
    schema: {
      users: {
        fields: {
          /* ... */
        },
        count: Math.min(batchSize, totalRecords - i),
      },
    },
  });
  batches.push(batch);
}
```

### Caching

```javascript
// Cache generated datasets
const cache = new Map();

async function getCachedDataset(schema, cacheKey) {
  if (cache.has(cacheKey)) {
    return cache.get(cacheKey);
  }

  const dataset = await client.generateData(schema);
  cache.set(cacheKey, dataset);
  return dataset;
}
```

## Next Steps

- **Explore [SDK Installation](/features/sdk)** for detailed setup guides
- **Check [API Reference](/features/api)** for complete API documentation
- **Review [Best practices](/best-practices)** for optimization tips
- **Join our [Community](https://community.syncora.ai)** for support
